package tds.study.nacos.consumer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author tds
 * @version 1.0.0
 * @Company 杭州先锋电子技术股份有限公司
 * @ClassName ConfigController
 * @Description TODO（这里用一句话描述这个类的作用)
 * @Date 2021-11-09 23:56
 */
@RestController
public class ConfigController {

    @Autowired
    private RestTemplate restTemplate;

    @RequestMapping("/serverPort")
    public String getPort() {
        return restTemplate.getForObject("http://nacos-payment" + "/config/serverPort", String.class);
    }

}
